<link rel="stylesheet" href="css/aliceui.min.css"/>
<link rel="stylesheet" href="css/resetui.css"/>
<link rel="stylesheet" href="css/prod_store.css"/>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=DE946147d82abf8082f7e80868ea8afb"></script>
<div class="wrapper">
<h3 class="mc_title">
	<span class="mctit_1"><span class="mctit_2">产品发布</span></span>
</h3>
<?if(!$isedit||isset($_GET['step'])){?>
	<ol class="ui-ministep step1">
	<li class="ui-ministep-item ui-ministep-active">
		<span class="ui-ministep-text"><?=$FieldList[$ptype]['ticket']['t4']?></span>
	</li>
	<li class="ui-ministep-item ">
		<span class="ui-ministep-text">子景点信息</span>
	</li>
	<li class="ui-ministep-item">
		<span class="ui-ministep-text"><?=$FieldList[$ptype]['ticket']['t1']?></span>
	</li>
</ol>
<?}?>
<?
if($ptype=='F' && !empty($package_data)) {
	include TPLPATH .'_package_box.html';
}
?>
<div id="sceneryBox" class="ui-box mt10 fn-clear">
	<?if($isedit){?>
		<div class="ui-box-head">
			<h3 class="ui-box-head-title"><?=$ProdTypes[$ptype]?>信息</h3>
			<span class="ui-box-head-text"></span>
			<a href="#" class="ui-box-head-more"></a>
		</div>
	<?}?>
	<div class="ui-box-container">
		<div class="ui-box-content">
			<form name="mainForm" id="mainForm" class="ui-form" method="post" action="call/uploadThumbImage.php" enctype="multipart/form-data" target="hideFrame">
				<input type="hidden" name="lastid" value="<?=$jdata['id']?>"/>
				<input type="hidden" name="applydid" value="<?=$apply_did?>"/>
			   
				<input type="hidden" name="action" value="CreateNewProduct"/>
				<input type="hidden" name="ptype" value="<?=$ptype?>"/>
				<input type="hidden" name="upload_mth" id="upload_mth" value="1"/> 
				
				<?=$input_pack?>
				<fieldset>
					<div class="ui-form-item">
						<label class="ui-label">
							<span class="ui-form-required">*</span><?=$FieldList[$ptype]['title']?>
						</label>
						<input title="请填写<?=$FieldList[$ptype]['title']?>" class="ui-input check w408" data-required="2" id="mainTitle" name="mainTitle" type="text" autofocus value="<?=$jdata['title']?>">
						<span class="ui-form-other ui-form-explain">请填写<?=$FieldList[$ptype]['title']?></span>
					</div>
					<?if(isset($FieldList[$ptype]['jtype'])){?>
						<div class="land ui-form-item">
							<?if(is_array($FieldList[$ptype]['jtype'])){?>
								<label data-s="<?=$jdata['jtype']?>" class="ui-label"><?=$FieldList[$ptype]['jtype']['t']?></label>
								<?=GetHtmlSelectByValue($FieldList[$ptype]['jtype']['list'],'jtype',$jdata['jtype'])?>
							<?} else {?>
								<label class="ui-label">
								<?=$FieldList[$ptype]['jtype']?>
								</label>
								<input class="ui-input w408" name="jtype" type="text" value="<?=$jdata['jtype']?>">
							<?}?>
							<span class="ui-form-other ui-form-explain"></span>
						</div>
					<?}?>
					<?if($f_vtime=$FieldList[$ptype]['vtime']){?>
						<div class="ui-form-item">
							<label class="ui-label"><?=$f_vtime?></label>
							<input type="radio" name="delaytime" value=1 <? if ($delaytime[0] || $delaytime[1]) echo 'checked'; ?> />是&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="delaytime" value=0 <? if (!$delaytime[0] && !$delaytime[1]) echo 'checked'; ?> />否&nbsp;&nbsp;&nbsp;&nbsp;
							<input type="text" name="vtimehour" class="ui-input" style="width:40px" title="请输入延迟小时" value="<?=$delaytime[0]?>"/>&nbsp;小时&nbsp;&nbsp;&nbsp;&nbsp;
							<input type="text" name="vtimeminu" class="ui-input" style="width:40px" title="请输入延迟分钟" value="<?=$delaytime[1]?>"/>&nbsp;分钟&nbsp;&nbsp;&nbsp;&nbsp;
							<br><span class="ui-form-explain">是否启用购票到验证的延迟时间，选‘是’请填入小时、分钟，格式为01小时 15分钟</span>
						</div>
					<?}?>
					<?if($FieldList[$ptype]['area']){?>
						<div class="ui-form-item">
							<label class="ui-label">
								<span class="ui-form-required">*</span>所在地区
							</label>
							<input type="hidden" value="<?=$jdata['area']?>" name="area"/>
							<span id="area"></span>
						</div>
					<?}?>
					<?if(isset($FieldList[$ptype]['address'])){?>
						<div class="land ui-form-item">
							<label class="ui-label"><span class="ui-form-required">*</span><?=$FieldList[$ptype]['address']?></label>
							<input type="text" name="mainAddress" id="address" class="w408 ui-input" title="请输入<?=$FieldList[$ptype]['address']?>" value="<?=$jdata['address']?>"/>
						</div>
					<?}?>
					<?if($FieldList[$ptype]['tel']){?>
						<div class="ui-form-item">
							<label class="ui-label">联系电话</label>
							<input type="text" name="mainPhoneNum" id="phone" class="ui-input w408" title="请输入联系电话" value="<?=$jdata['tel']?>"/>
							<span class="ui-form-explain">手机或固话（固话格式：区号-电话号码）</span>
						</div>
					<?}?>
					 
					<div id="container" style="position: absolute;margin-top:30px; width: 3px; height: 3px; display:none;top: 50; border: 1px solid gray;overflow:hidden;"></div> 
						
					<?if(isset($FieldList[$ptype]['runtime'])){?>
						<div class="land ui-form-item">
							<label class="ui-label"><?=$FieldList[$ptype]['runtime']?></label>
							<input class="ui-input w408" id="runtime" name="runtime" type="text" value="<?=$jdata['runtime']?>">
							<span class="ui-form-other ui-form-explain"></span>
						</div>
					<?}?>
					<?if($FieldList[$ptype]['place']){?>
						<div class="land ui-form-item">
							<input type="hidden" name="start_place_tude" id="result_"/>
							<label class="ui-label"><span class="ui-form-required">*</span>出发地</label>
							<input class="ui-input" data-required="1" id="text_"  name="" type="text" value="">
							<span class="ui-form-other ui-form-explain"></span>
							<input type="text" id="result_aa" readonly="true" style="border-style:none">
						</div>
						<div class="land ui-form-item">
							<input type="hidden" name="end_place_tude" id="result_b"/>
							<label class="ui-label"><span class="ui-form-required">*</span>目的地</label>
							<input class="ui-input" data-required="1" name="" id="text_b" type="text" onBlur="searchByStationName();" value="">
							<span class="ui-form-other ui-form-explain"></span>
							<input type="text" id="result_bb" readonly="true" style="border-style:none">
						</div> 
						<div class="land ui-form-item">
							<label data-s="" class="ui-label">排序</label>
							<input class="ui-input w40" name="px" type="text" value="<?=$jdata['runtime']?>">
							<span class="ui-form-other ui-form-explain"></span>
						</div>
						<div class="land ui-form-item">
							<label data-s="" class="ui-label">推荐级别</label>
							<select name="jtype">
								<option value="AAAAA">AAAAA</option>
								<option value="AAAA">AAAA</option>
								<option value="AAA">AAA</option>
								<option value="AA">AA</option>
								<option value="A">A</option>
								<option value="非A级">非A级</option>
							</select>                                                        <span class="ui-form-other ui-form-explain"></span>
						</div>
					<?}?>
					<?if($ptype!='C'){?> 
					<div class="ui-form-item">
						<label class="ui-label"><?=$FieldList[$ptype]['topic']['t']?></label>
						<ul class="topicList">
							<?foreach($ProdcutTopic as $topic){?>
								<li><label><input type="checkbox" name="topic[]" <?=in_array($topic, $topicList) ? 'checked':''?> value="<?=$topic?>"/><?=$topic?></label></li>
							<?}?>
						</ul>
					</div>
					<?}?>
					<div class="ui-form-item">
						<label class="ui-label">
							<span class="ui-form-required">*</span>
							<?=$FieldList[$ptype]['jqts']['t']?>
						</label>
						<textarea id="buyTips" name="buyTips" data-required="2" title="请输入购买须知"class="ui-textarea w634"><?=isset($jdata['jqts'])?$jdata['jqts']:$FieldList[$ptype]['jqts']['tp']?></textarea>
						<a href="javascript:" title="添加一行" class="dbtn addclom">+</a>
						<a href="javascript:" title="减少一行" class="dbtn cutclom">-</a>
					</div>
					<div class="ui-form-item">
						<label class="ui-label">
							<span class="ui-form-required">*</span>
							<?=$FieldList[$ptype]['bhjq']['t']?>
						</label>
						<textarea id="detailInfo" name="detailInfo" data-required="2" title="请输入<?=$FieldList[$ptype]['bhjq']['t']?>" ><?=isset($jdata['bhjq'])?$jdata['bhjq']:$FieldList[$ptype]['bhjq']['tp']?><?=$package_content?></textarea>
					</div>
					<?if(isset($FieldList[$ptype]['jtzn'])){?>
						<div class="ui-form-item">
							<label class="ui-label"> <?=$FieldList[$ptype]['jtzn']['t']?> </label>
							<textarea id="traffic" name="trafficInfo" class="ui-textarea w634"><?=isset($jdata['jtzn'])?strip_tags(htmlspecialchars_decode($jdata['jtzn'])):$FieldList[$ptype]['jtzn']['tp']?></textarea>
							<a href="javascript:" title="添加一行" class="dbtn addclom">+</a>
							<a href="javascript:" title="减少一行" class="dbtn cutclom">-</a>
							<p class="ui-form-explain">填写交通路线等信息</p>
						</div>
					<?}?>
					<!--thumb image-->
					<div class="ui-form-item" style="position: relative;">
						<label class="ui-label">
							<span class="ui-form-required">*</span>缩略图
						</label>
						<a id="lnk_prv" target="_blank" title="点击查看原图" href="<?=$imgUrl?>">
							<input type="hidden" name="thumb_img" id="thumb_img" value="<?=$imgUrl?>"/>
							<img style="width:240px;height:160px;" src="<?=$imgUrl?>" id="preview" />
						</a>
						<div class="uploadImg">
							<p class="title">重新上传缩略图：</p>
							<input type="file" name="upfile" id="imgup"/>
							<input type="button" id="BtnUpload" value="上传" class="ui-button ui-button-swhite"/>
							<p class="ui-form-explain">点击上传小于1M的JPG或GIF格式的图片,<br/>建议图片尺寸：宽350像素，高230像素</p>
							<p id="waitingUpload" class="ui-form-other"></p>
						</div>
						<p class="ui-form-explain">默认将使用商户提供的缩略图作为页面展示的图片</p>
					</div>
					<div class="ui-form-item"><?=$saveBtn?></div>
				</fieldset>
			</form>
		</div>
	</div>
</div>
</div>
<ul id="mainAreas"></ul>
<iframe src="about:blank" style="display: none;" id="hideFrame" name="hideFrame" frameborder="0"></iframe>
<script src="js/jquery.getareas.js" type="text/javascript"></script>
<!-- 配置文件 -->
<script type="text/javascript" charset="utf-8" src="ue_126/ueditor_config_mini.js"></script>
<!-- 核心文件 -->
<script type="text/javascript" src="js/easydialog.min.js" ></script>
<script type="text/javascript" src="ue_126/ueditor.all.min.js"></script>
<script type="text/javascript" src="js/prod_pub.js"></script>
<script type="text/javascript" src="js/prod_editk_v3_y.js?body=1"></script>
<?if($ptype=='B'){?>
<script type="text/javascript" src="js/area.js"></script>
<script type="text/javascript" src="js/area_complete.js"></script>
<?}?>
<script type="text/javascript">
var map = new BMap.Map("container");
map.centerAndZoom("福州", 12);
map.enableScrollWheelZoom();    //启用滚轮放大缩小，默认禁用
map.enableContinuousZoom();    //启用地图惯性拖拽，默认禁用
map.addControl(new BMap.NavigationControl());  //添加默认缩放平移控件
map.addControl(new BMap.OverviewMapControl()); //添加默认缩略地图控件
map.addControl(new BMap.OverviewMapControl({ isOpen: true, anchor: BMAP_ANCHOR_BOTTOM_RIGHT }));   //右下角，打开
var localSearch = new BMap.LocalSearch(map);
var localSearchb = new BMap.LocalSearch(map);
localSearch.enableAutoViewport(); //允许自动调节窗体大小
function searchByStationName() {
	//function getVal(id) {
	map.clearOverlays();//清空原来的标注
	var keyword = document.getElementById("text_").value;
	var keywordb = document.getElementById("text_b").value;
	localSearch.setSearchCompleteCallback(function (searchResult) {
	var poi = searchResult.getPoi(0);
	document.getElementById("result_").value = poi.point.lng + "," + poi.point.lat;
	document.getElementById("result_aa").value = poi.point.lng + "," + poi.point.lat;
	//var mapid = document.getElementById("result_").value = poi.point.lng + "," + poi.point.lat;
	map.centerAndZoom(poi.point, 13);
	var marker = new BMap.Marker(new BMap.Point(poi.point.lng, poi.point.lat));  // 创建标注，为要查询的地方对应的经纬度
	map.addOverlay(marker);
	var content = document.getElementById("text_").value + "<br/><br/>经度：" + poi.point.lng + "<br/>纬度：" + poi.point.lat;
	var infoWindow = new BMap.InfoWindow("<p style='font-size:14px;'>" + content + "</p>");
	marker.addEventListener("click", function () { this.openInfoWindow(infoWindow); });
	marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
	//alert(mapid)
	});
	localSearchb.setSearchCompleteCallback(function (searchResult) {
	var poi = searchResult.getPoi(0);
	document.getElementById("result_b").value = poi.point.lng + "," + poi.point.lat;
	document.getElementById("result_bb").value = poi.point.lng + "," + poi.point.lat;
	//var mapid = document.getElementById("result_").value = poi.point.lng + "," + poi.point.lat;
	map.centerAndZoom(poi.point, 13);
	var marker = new BMap.Marker(new BMap.Point(poi.point.lng, poi.point.lat));  // 创建标注，为要查询的地方对应的经纬度
	map.addOverlay(marker);
	var content = document.getElementById("text_b").value + "<br/><br/>经度：" + poi.point.lng + "<br/>纬度：" + poi.point.lat;
	var infoWindow = new BMap.InfoWindow("<p style='font-size:14px;'>" + content + "</p>");
	marker.addEventListener("click", function () { this.openInfoWindow(infoWindow); });
	marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
	//alert(mapid)
	});
	localSearch.search(keyword);
	localSearchb.search(keywordb);
} 
</script>
<!--日历-->
<!--    <script type="text/javascript" src="js/Calendar.js"></script>-->